<div class="content-wrapper">
    <section class="content-header">
        <h1>跟进客户</h1>
        <ol class="breadcrumb">
            <li><a href="/admin"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">客户管理</li>
            <li class="active"><a href="/admin/itemCate/cateList">客户列表</a></li>
            <li class="active">跟进客户</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-6">
                <div class="box box-primary">
                    <div class="box-header with-border">
                    </div>
                    <div class="box-body">
                        <form class="form-horizontal" action="javascript:;" method="post">
                            <input type="hidden" id="customer_id" name="customer_id" value="{$customer_id}">
                            <div class="form-group">
                                <label class="col-md-2">跟进信息</label>
                                <div class="col-md-10">
                                    <textarea class="form-control" id="description" name="description" placeholder="输入跟进信息" rows="8" required></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2"></label>
                                <div class="col-md-6">
                                    <button type="button" class="btn btn-success pull-right" id="save-info">保存</button>&nbsp;
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="box box-primary">
                    <div class="box-header with-border">
                    </div>
                    <div class="box-body">

                        <!-- row -->
                        <div class="row">
                            <div class="col-md-12">

                                <!-- The time line -->
                                <ul class="timeline">
                                    <if condition="count($logList) eq 0"><li><div class="timeline-body text-center">暂无数据...</div></li></if>
                                    <!-- timeline item -->
                                    <foreach name="logList" item="log">
                                        <li>
                                            <i class="fa fa-comments bg-green-active"></i>

                                            <div class="timeline-item">
                                                <span class="time"><i class="fa fa-clock-o"></i> {$log.create_time|friend_date}</span>

                                                <h3 class="timeline-header"><a href="#">{$log.admin_name}</a> <span class="text text-red">跟进客户:{$log.customer_name}</span></h3>

                                                <div class="timeline-body">{$log.description}</div>
                                            </div>
                                        </li>
                                    </foreach>
                                    <!-- END timeline item -->
                                </ul>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                </div>
                <div class="box-footer clearfix">{$page_html}</div>
            </div>
        </div>
    </section>
</div>
<script src="__PUBLIC__/AdminLTE/plugins/layer/layer.js"></script>
<script type="application/javascript">
    $('#save-info').click(function () {
        var customer_id = $("#customer_id").val();
        var description = $("#description").val();

        if(description==''){
            layer.msg('请填写跟进信息',{
                time:1000
            });
            return false;
        }
        $.post('/admin/customer/ajaxSavePhaseLog',{
            customer_id: customer_id,
            description: description
        },function (data) {
            if(data.Code==999){
                layer.msg('操作成功',{time:1000});
                window.location.reload(true);
            }else{
                layer.msg(data.Msg,{time:1000});
            }
        },"JSON");
    });
</script> 